package com.voicechat.firstmet.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @ProjectName: FirstMet
 * @Package: com.voicechat.firstmet.bean
 * @ClassName: CoummunityNotice
 * @Description: 社区公告
 * @Author: ljp
 * @CreateDate: 2018/10/9 14:06
 * @Version: 1.0
 */
public class CoummunityNotice  implements Parcelable{


    /**
     * code : 200
     * msg : 成功
     * page : {"pageNo":1,"pageSize":30,"count":3,"list":[{"id":"3","isNewRecord":false,"updateDate":"2018-11-09 14:40:16","title":"好消息,好消息","content":"尊敬的各位小主,产品更新后,将给大家退出一款全新的功能,敬请期待"},{"id":"2","isNewRecord":false,"updateDate":"2018-10-31 10:14:03","title":"系统更新","content":"尊敬的各位小主,产品将于2020年10月31号更新,给您带来不便请谅解"},{"id":"1","isNewRecord":false,"updateDate":"2018-09-19 11:07:01","title":"隐隐通知","content":"xxx主播因xxx问题限制其使用权!!!"}],"firstResult":0,"maxResults":30}
     */

    private int code;
    private String msg;
    private PageBean page;

    protected CoummunityNotice(Parcel in) {
        code = in.readInt();
        msg = in.readString();
    }

    public static final Creator<CoummunityNotice> CREATOR = new Creator<CoummunityNotice>() {
        @Override
        public CoummunityNotice createFromParcel(Parcel in) {
            return new CoummunityNotice(in);
        }

        @Override
        public CoummunityNotice[] newArray(int size) {
            return new CoummunityNotice[size];
        }
    };

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public PageBean getPage() {
        return page;
    }

    public void setPage(PageBean page) {
        this.page = page;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(code);
        dest.writeString(msg);
    }

    public static class PageBean {
        /**
         * pageNo : 1
         * pageSize : 30
         * count : 3
         * list : [{"id":"3","isNewRecord":false,"updateDate":"2018-11-09 14:40:16","title":"好消息,好消息","content":"尊敬的各位小主,产品更新后,将给大家退出一款全新的功能,敬请期待"},{"id":"2","isNewRecord":false,"updateDate":"2018-10-31 10:14:03","title":"系统更新","content":"尊敬的各位小主,产品将于2020年10月31号更新,给您带来不便请谅解"},{"id":"1","isNewRecord":false,"updateDate":"2018-09-19 11:07:01","title":"隐隐通知","content":"xxx主播因xxx问题限制其使用权!!!"}]
         * firstResult : 0
         * maxResults : 30
         */

        private int pageNo;
        private int pageSize;
        private int count;
        private int firstResult;
        private int maxResults;
        private List<ListBean> list;


        @Override
        public String toString() {
            return "PageBean{" +
                    "pageNo=" + pageNo +
                    ", pageSize=" + pageSize +
                    ", count=" + count +
                    ", firstResult=" + firstResult +
                    ", maxResults=" + maxResults +
                    ", list=" + list +
                    '}';
        }

        public int getPageNo() {
            return pageNo;
        }

        public void setPageNo(int pageNo) {
            this.pageNo = pageNo;
        }

        public int getPageSize() {
            return pageSize;
        }

        public void setPageSize(int pageSize) {
            this.pageSize = pageSize;
        }

        public int getCount() {
            return count;
        }

        public void setCount(int count) {
            this.count = count;
        }

        public int getFirstResult() {
            return firstResult;
        }

        public void setFirstResult(int firstResult) {
            this.firstResult = firstResult;
        }

        public int getMaxResults() {
            return maxResults;
        }

        public void setMaxResults(int maxResults) {
            this.maxResults = maxResults;
        }

        public List<ListBean> getList() {
            return list;
        }

        public void setList(List<ListBean> list) {
            this.list = list;
        }

        public static class ListBean implements Parcelable{
            /**
             * id : 3
             * isNewRecord : false
             * updateDate : 2018-11-09 14:40:16
             * title : 好消息,好消息
             * content : 尊敬的各位小主,产品更新后,将给大家退出一款全新的功能,敬请期待
             */

            private String id;
            private boolean isNewRecord;
            private String updateDate;
            private String title;
            private String content;
            private String  url;                  // banner图片地址
            private String  h5Url;                // H5地址

            private String createDate;

            public String getCreateDate() {
                return createDate;
            }

            public void setCreateDate(String createDate) {
                this.createDate = createDate;
            }

            protected ListBean(Parcel in) {
                id = in.readString();
                isNewRecord = in.readByte() != 0;
                updateDate = in.readString();
                title = in.readString();
                content = in.readString();
            }

            public static final Creator<ListBean> CREATOR = new Creator<ListBean>() {
                @Override
                public ListBean createFromParcel(Parcel in) {
                    return new ListBean(in);
                }

                @Override
                public ListBean[] newArray(int size) {
                    return new ListBean[size];
                }
            };

            public String getUrl() {
                return url;
            }

            public void setUrl(String url) {
                this.url = url;
            }

            public String getH5Url() {
                return h5Url;
            }

            public void setH5Url(String h5Url) {
                this.h5Url = h5Url;
            }

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public boolean isIsNewRecord() {
                return isNewRecord;
            }

            public void setIsNewRecord(boolean isNewRecord) {
                this.isNewRecord = isNewRecord;
            }

            public String getUpdateDate() {
                return updateDate;
            }

            public void setUpdateDate(String updateDate) {
                this.updateDate = updateDate;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public String getContent() {
                return content;
            }

            public void setContent(String content) {
                this.content = content;
            }

            @Override
            public String toString() {
                return "ListBean{" +
                        "id='" + id + '\'' +
                        ", isNewRecord=" + isNewRecord +
                        ", updateDate='" + updateDate + '\'' +
                        ", title='" + title + '\'' +
                        ", content='" + content + '\'' +
                        '}';
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(id);
                dest.writeByte((byte) (isNewRecord ? 1 : 0));
                dest.writeString(updateDate);
                dest.writeString(title);
                dest.writeString(content);
            }
        }

    }
}
